Skip to content

fix: align nginx/certbot config with sav.com DNS — cover api + orchestrator subdomains, fix Hetzner deploy failures#157

Merged
ruffy80 merged 3 commits into
mainfrom
copilot/fix-deployment-issues-hertzner
Apr 13, 2026
Merged

fix: align nginx/certbot config with sav.com DNS — cover api + orchestrator subdomains, fix Hetzner deploy failures#157
ruffy80 merged 3 commits into
mainfrom
copilot/fix-deployment-issues-hertzner

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Three independent bugs caused repeated Hetzner SSH deploy failures and incomplete SSL coverage across all DNS-registered subdomains (@, www, api, orchestrator, *204.168.230.142; SSL/DDoS off at registrar, so Hetzner handles everything).

Deploy pipeline failures (deploy-hetzner.yml, deploy-backend.yml, package.json)

  • Root cause: SSH scripts ran npm run lint from repo root (/opt/unicorn), which has no lint script → Missing script: lint on every push.
    • Added "lint": "npm --prefix UNICORN_FINAL run lint" to root package.json
    • Both deploy scripts now explicitly target UNICORN_FINAL for lint/test/install
  • Secondary: npm install only ran at repo root, not in UNICORN_FINAL/ — app deps could be stale after pull
  • ERR trap bug: quantum-integrity health check || (echo ... && false) fired the rollback trap on unavailable endpoints, failing deploys that were otherwise successful. Moved trap - ERR before all post-deploy health checks.

Nginx server_name truncation (fix-server.sh)

fix-server.sh copied nginx-unicorn.conf (which correctly lists all 4 hostnames) then immediately overwrote server_name with only 2:

# Before — drops api. and orchestrator.
sed -i "s/server_name .*;/server_name ${DOMAIN} www.${DOMAIN};/" "$NGINX_AVAILABLE"

# After — matches all DNS A records
sed -i "s/server_name .*;/server_name ${DOMAIN} www.${DOMAIN} api.${DOMAIN} orchestrator.${DOMAIN};/" "$NGINX_AVAILABLE"

Same fix applied to the inline fallback config generated when nginx-unicorn.conf is missing.

Certbot covers only 2 of 4 subdomains (fix-server.sh)

With SSL/DDoS off at sav.com, Let's Encrypt is the sole TLS provider. Certbot was only requesting certs for zeusai.pro and www.zeusai.proapi.zeusai.pro and orchestrator.zeusai.pro had no HTTPS. Now auto-obtains a single cert covering all four with --redirect:

certbot --nginx \
  -d "${DOMAIN}" -d "www.${DOMAIN}" -d "api.${DOMAIN}" -d "orchestrator.${DOMAIN}" \
  --non-interactive --agree-tos -m "admin@${DOMAIN}" --redirect

Copilot AI and others added 3 commits April 13, 2026 20:51
…s, quantum-integrity trap

Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/b5f0e4cb-c0a9-4d8a-b10a-f135fe3e9621

Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
…(api, orchestrator)

Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/002535d1-6c3e-4193-a478-b3554007a59f

Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
@vercel

vercel Bot commented Apr 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zeusai Ready Ready Preview, Comment Apr 13, 2026 9:02pm

Request Review

@ruffy80 ruffy80 marked this pull request as ready for review April 13, 2026 21:02
@ruffy80 ruffy80 merged commit 1a8b5db into main Apr 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants